package com.wzh.musichome.cfg;

/**
 * @文件描述
 * @作者 alexhigger
 * @创作日期 2020/11/29 23:43
 */


import com.wzh.musichome.Interceptor.AuthenticationFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Autowired
    private AuthenticationFilter authenticationFilter;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authenticationFilter).
                addPathPatterns("/**").
                excludePathPatterns("/user/login")
                .excludePathPatterns("/user/register");

    }
}

